package com.qhw.test1;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AppCore {
    public static void main(String[] args) throws Exception{
        Class<?> C = Class.forName("com.qhw.test1.CustomService");
        Object c = C.newInstance();
        Class<?> UU = Class.forName("com.qhw.test1.UserService");
       // Object o = UU.newInstance();
      //  Method randomString = UU.getDeclaredMethod("randomString");
        Field service = C.getDeclaredField("service");
        service.setAccessible(true);
       service.set(c,UU.newInstance());
      //  service.set(c,randomString.invoke(o));
        Method say = C.getDeclaredMethod("say");
        say.invoke(c);
    }
}
